package com.huipinche.view.utils;

import javax.swing.*;
import java.awt.*;

public class BackGroundPanel extends JPanel {
    //声明图片
    private Image image = null;
    public BackGroundPanel(Image image){
        this.image = image;
    }

    @Override
    public void paintComponent(Graphics g) {
        super.paintComponent(g);
        //绘制背景
        g.drawImage(image,0,0,this.getWidth(),this.getHeight(),null);

    }
}
